<template>
	<view>
		<view class="rankinglist" v-for="(item,index) in rankinglist" :key="index">
			<view class="left">
				<view class="number">
					{{index + 1}}
				</view>
				<view class="image">
					<image :src="imgurl + item.image" mode=""></image>
				</view>
			</view>
			<view class="right">
				<view class="">
					{{item.name}}
				</view>
				<view class="">
					完成单量{{item.orderNum}}单
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			page:1,
			rankinglist:[],//排行榜
			imgurl:this.$imgurl,
			}
		},
		onLoad() {
			this.getranking()
		},
		onPullDownRefresh() {
		        console.log('refresh');
				this.getranking()
		        setTimeout(function () {
		            uni.stopPullDownRefresh();
		        }, 1000);
		    },
		methods: {
			//获取排行榜
			getranking(){
				var that = this
				var data = {
				}
				that.$http('/api/user/store/getMassagistOrderNumList?storeId=' + 1 +  'limit=' + 20 + '&page=' + that.page, 'POST', data).then((res) => {
					console.log('排行榜', res.data.data.list)
					that.rankinglist = res.data.data.list
				})
			},
		}
	}
</script>

<style lang="scss">
image{
	width: 100%;
	height: 100%;
}
.rankinglist{
	display: flex;
	padding: 20rpx;
	border-bottom: 1rpx solid #ECECEC;
	.left{
		flex: 0 0 30%;
		display: flex;
		align-items: center;
		justify-content: space-between;
		.number{
			color: red;
			font-size: 40rpx;
		}
		.image{
			width: 120rpx;
			height: 120rpx;
			image{
				border-radius: 50%;
			}
		}
	}
	.right{
		flex: 0 0 70%;
		display: flex;
		flex-direction: column;
		justify-content: space-around;
		padding-left: 20rpx;
	}
}
</style>
